import request from '@/utils/request'

export function add(data) {
  return request({
    url: 'api/wareBuyEnter/addOrSave',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/wareBuyEnter/',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/wareBuyEnter/addOrSave',
    method: 'post',
    data
  })
}

export function copy(data) {
  return request({
    url: 'api/wareBuyEnter/copy',
    method: 'post',
    data
  })
}

export function exportDe(data) {
  return request({
    url: 'api/wareBuyEnter/export',
    method: 'get',
    data
  })
}

export function importDe(data) {
  return request({
    url: 'api/wareBuyEnter/import',
    method: 'post',
    data
  })
}

export function passOrReject(data) {
  const obj = {
    url: 'api/wareBuyEnter/passOrReject',
    method: 'post',
    data
  }
  return request(obj)
}
export function enableOrDisable(data) {
  const obj = {
    url: 'api/wareBuyEnter/passOrReject',
    method: 'post',
    data
  }
  return request(obj)
}

export function removeDetail(data) {
  const obj = {
    url: 'api/wareBuyEnter/removeDetail',
    method: 'post',
    data
  }
  return request(obj)
}
export function detail(params) {
  const obj = {
    url: 'api/wareBuyEnter/detail',
    method: 'get',
    params
  }
  return request(obj)
}
export function exportDetail(data) {
  return request({
    url: 'api/wareBuyEnter/exportDetail',
    method: 'get',
    data
  })
}

export function print(data) {
  return request({
    url: 'api/wareBuyEnter/print',
    method: 'post',
    responseType: 'blob',
    data
  })
}
export function assignGroundUser(data) {
  const obj = {
    url: 'api/wareBuyEnter/assignGroundUser',
    method: 'post',
    data
  }
  return request(obj)
}
export function getWareBuyEnterPreviousNextPageIdList(data) {
  const obj = {
    url: '/api/wareBuyEnter/getWareBuyEnterPreviousNextPageIdList',
    method: 'get',
    params: data
  }
  return request(obj)
}

export default { add, edit, copy, exportDe, importDe, del, passOrReject, enableOrDisable, removeDetail, detail, exportDetail, print, assignGroundUser }
